Skip to main content
Version: Upcoming

SRPairLeggerState

V8 Message Definiton

METADATA

AttributeValue
Topic5355-strategy-legger
MLink TokenInternal
ProductSRTrade
accessTypeSELECT

Table Definition

FieldTypeKeyDefault ValueComment
orderNumberCHAR(19)PRI'0000-0000-0000-0000'pair legger order number should be an SR Guid
spdrSourceenum - SpdrSource'None'
accntVARCHAR(16)''SR trading account
clientFirmVARCHAR(16)''SR client firm
pairCtrlStateenum - PairCtrlState'None'
pairStateenum - PairState'None'
strategyVARCHAR(36)''clientsupplied strategy string visible on SpiderRock GUI tools and other order reports
userNameVARCHAR(24)''name of the user entering the order
orderSizeINT0pair size number of complete spreads
leggerLimitDOUBLE0pair limit
leggerLimitTypeenum - LeggerLimitType'None'pair limit type stock Price future Price optExpiry AtmVol only option Price or StrikeVol
leggerAlgoenum - LeggerAlgo'None'
legRatioTypeenum - LegRatioType'None'
numAtmStrikesSMALLINT UNSIGNED0number of OptExpiry atm strikes max 6
legExposurePctFLOAT0percentage of legger order size than can be exposed on a single leg without completing related legs
legCompletionSlippageDOUBLE0maximum leg slippage to complete an open pair order in leggerLimitType units
marketSessionenum - MarketSession'None'
orderDurationINT0optional number of seconds
goodTillDttmDATETIME(6)'1900-01-01 00:00:00.000000'optional default 20990101
maxMktPctMoveDOUBLE0optional if any leg stock price future price or option underlier price moves move that maxMktPctMove from values at order activation then the entire order will be automatically put on hold
autoHedgeenum - AutoHedge'None'only for optExpiryoptExpiry and optionoption pairs
hedgeSessionenum - MarketSession'None'
userData1TINYTEXT''client supplied data field passes through to parent and child executions and reports as well as FIX drops
userData2TINYTEXT''client supplied data field passes through to parent and child executions and reports as well as FIX drops
childDataTINYTEXT''client supplied data field passes through to down stream child orders
pairStatusenum - PairStatus'None'
pairDetailTINYTEXT''
cumSquareFillQtyINT0
cumPartialFillQtyINT0
avgSquareFillPrcDOUBLE0
pairBidPxDOUBLE0synthetic pair bid from individual leg markets
pairAskPxDOUBLE0synthetic pair ask from individual leg markets
pairBidSzDOUBLE0
pairAskSzDOUBLE0
timestampDATETIME(6)'1900-01-01 00:00:00.000000'
LegsListJSON'JSON_ARRAY()'

PRIMARY KEY DEFINITION (Unique)

FieldSequence
orderNumber1

JSON Block (LegsList)

FieldTypeComment
secKeyenum - secKeyleg Security can be a stock future optExpiry or option must be the same for all legs cp can be call put or both if secType optExpiry
secTypeenum - LeggerSecTypenote stockstock stockfuture futurefuture optExpiryoptExpiry or optionoption are allowed
ratioenum - ratioleg ratio note can be in shares contracts vega wvega tvega or wtvega terms optExpiry must be in one of the xVega choices
legPriorityenum - LegPriorityLead legs fill first
posTypeenum - PositionTypenote must be Auto for optExpiry not required for stock
ssaleFlagenum - ShortSaleFlagonly for stock legs and autohedging
hedgeInstrumentenum - HedgeInst
hedgeSecKeyenum - hedgeSecKeyautohedge instrument can be a TickerKey stock or ExpiryKey future required for Stock and Future
orderSizeenum - orderSizeworking size from parentBrkrStateorderSize sum of all individual orders in cnshare terms
orderActiveSizeenum - orderActiveSizeorder active size from parentBrkrStateorderActiveSize sum of all individual orders in cnshare terms
numActiveBrkrsenum - numActiveBrkrsnumber of parent order legs with legactiveSize legcumFillQty
numAvailLegBrkrsenum - numAvailLegBrkrsnumber of parent order legs created
cumFillQtyenum - cumFillQtyin LeggerLimitType terms
avgFillPrcenum - avgFillPrc
activeSprdSizeenum - activeSprdSizeactive size sum of all individual orders in ratio type terms
legStatusenum - legStatus
targetStateenum - LeggerTargetState
targetSprdSizeenum - targetSprdSize
targetLimitPriceenum - targetLimitPrice
bestBidPrcenum - bestBidPrcleg best bid price in terms of limit type
bestAskPrcenum - bestAskPrcleg best ask price
bestBidSizeenum - bestBidSizeleg best bid size in terms of ratio type
bestAskSizeenum - bestAskSizeleg best ask size
numNewOrdersenum - numNewOrdersnumber of parent orders published
numLimitUpdatesenum - numLimitUpdatesnumber of parent limit messages published

CREATE TABLE EXAMPLE QUERY

CREATE TABLE `SRTrade`.`MsgSRPairLeggerState` (
`orderNumber` CHAR(19) NOT NULL DEFAULT '0000-0000-0000-0000' COMMENT 'pair legger order number (should be an SR Guid)',
`spdrSource` ENUM('None','SpdrTicket','SpdrSingle','SRSE','FIX','HedgeTool','TradeHedge','OpenHedge','AutoHedge','Orphan','RiskManager','OrderManager','ManagedOrder','RFQRespSrvr','Legger','SRSEDrop','FixDrop','TicketDrop','SysTest','RFRResponse','AllocOmni','AllocClient','CertGateway','MLegResponse','LeggerX','DropManager','AutoHedgeSrvr','AuctionStrategySrvr','AllocBlockFace','AllocBlockCust','IceChatGateway','EXS2SRC','MLinkResponse','AutoResponderVD','AutoResponderRC','AutoResponderSN','AutoResponderBX','MLink','SymChatGateway','RiskDrop','PolicyOpn','PolicyTrd','PolicyExe') NOT NULL DEFAULT 'None',
`accnt` VARCHAR(16) NOT NULL DEFAULT '' COMMENT 'SR trading account',
`clientFirm` VARCHAR(16) NOT NULL DEFAULT '' COMMENT 'SR client firm',
`pairCtrlState` ENUM('None','Preview','AddUpdate','Hold','Cancel') NOT NULL DEFAULT 'None',
`pairState` ENUM('None','Preview','Working','PendWork','Closed','PendClose','Suspended','Rejected') NOT NULL DEFAULT 'None',
`strategy` VARCHAR(36) NOT NULL DEFAULT '' COMMENT 'client-supplied strategy string; visible on SpiderRock GUI tools and other order reports.',
`userName` VARCHAR(24) NOT NULL DEFAULT '' COMMENT 'name of the user entering the order',
`orderSize` INT NOT NULL DEFAULT 0 COMMENT 'pair size (number of complete spreads)',
`leggerLimit` DOUBLE NOT NULL DEFAULT 0 COMMENT 'pair limit',
`leggerLimitType` ENUM('None','Prc','StrikeVol','AtmVol') NOT NULL DEFAULT 'None' COMMENT 'pair limit type (stock: Price, future: Price, optExpiry: AtmVol only, option: Price or StrikeVol)',
`leggerAlgo` ENUM('None','LegHidden','LegOutLoud') NOT NULL DEFAULT 'None',
`legRatioType` ENUM('None','Qty','Vega','WVega','TVega','WtVega') NOT NULL DEFAULT 'None',
`numAtmStrikes` SMALLINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'number of OptExpiry atm strikes [max 6]',
`legExposurePct` FLOAT NOT NULL DEFAULT 0 COMMENT 'percentage of legger order size than can be exposed on a single leg without completing related legs',
`legCompletionSlippage` DOUBLE NOT NULL DEFAULT 0 COMMENT 'maximum leg slippage to complete an open pair order (in leggerLimitType units)',
`marketSession` ENUM('None','PreMkt','RegMkt','PostMkt','PreRegMkt','RegPostMkt','AllDay') NOT NULL DEFAULT 'None',
`orderDuration` INT NOT NULL DEFAULT 0 COMMENT '[optional] (number of seconds)',
`goodTillDttm` DATETIME(6) NOT NULL DEFAULT '1900-01-01 00:00:00.000000' COMMENT '[optional] (default: 2099-01-01)',
`maxMktPctMove` DOUBLE NOT NULL DEFAULT 0 COMMENT '[optional] if any leg stock price, future price, or option underlier price moves move that maxMktPctMove from values at order activation then the entire order will be automatically put on hold',
`autoHedge` ENUM('None','Static','AutoMid','AutoCrx','AutoTrn','SpdrAuto','Spdr10S','Spdr30S','Spdr90S','Spdr5M','Spdr30M','SpdrDay','SmartFast','SmartNorm','FastCrx','FastDark','SlowDark','AlphaVwap1pct','AlphaVwap2pct','AlphaVwap5pct','AlphaVwap25pct','Custom','AwayAlgo','EuMsAlgo','Policy') NOT NULL DEFAULT 'None' COMMENT 'only for optExpiry/optExpiry and option/option pairs',
`hedgeSession` ENUM('None','PreMkt','RegMkt','PostMkt','PreRegMkt','RegPostMkt','AllDay') NOT NULL DEFAULT 'None',
`userData1` TINYTEXT NOT NULL DEFAULT '' COMMENT 'client supplied data field; passes through to parent and child executions and reports as well as FIX drops',
`userData2` TINYTEXT NOT NULL DEFAULT '' COMMENT 'client supplied data field; passes through to parent and child executions and reports as well as FIX drops',
`childData` TINYTEXT NOT NULL DEFAULT '' COMMENT 'client supplied data field; passes through to down stream child orders',
`pairStatus` ENUM('None','PreviewCreated','LeggerCreated','LeggerUpdated','Exception','UpdtError','LegBrkrClosed','LegBrkrReject','LegBrkrTimeout','LeggerCancel','LeggerFilled','LeggerExpired','LeggerReject','PreviewReject') NOT NULL DEFAULT 'None',
`pairDetail` TINYTEXT NOT NULL DEFAULT '',
`cumSquareFillQty` INT NOT NULL DEFAULT 0,
`cumPartialFillQty` INT NOT NULL DEFAULT 0,
`avgSquareFillPrc` DOUBLE NOT NULL DEFAULT 0,
`pairBidPx` DOUBLE NOT NULL DEFAULT 0 COMMENT 'synthetic pair bid (from individual leg markets)',
`pairAskPx` DOUBLE NOT NULL DEFAULT 0 COMMENT 'synthetic pair ask (from individual leg markets)',
`pairBidSz` DOUBLE NOT NULL DEFAULT 0,
`pairAskSz` DOUBLE NOT NULL DEFAULT 0,
`timestamp` DATETIME(6) NOT NULL DEFAULT '1900-01-01 00:00:00.000000',
`LegsList` JSON NOT NULL DEFAULT JSON_ARRAY() CHECK(JSON_VALID(LegsList)),
CONSTRAINT nonnegative_orderNumber CHECK(ASCII(orderNumber) < 56),
PRIMARY KEY USING HASH (`orderNumber`)
) ENGINE=SRSE DEFAULT CHARSET=LATIN1 COMMENT='';

SELECT TABLE EXAMPLE QUERY

SELECT
`orderNumber`,
`spdrSource`,
`accnt`,
`clientFirm`,
`pairCtrlState`,
`pairState`,
`strategy`,
`userName`,
`orderSize`,
`leggerLimit`,
`leggerLimitType`,
`leggerAlgo`,
`legRatioType`,
`numAtmStrikes`,
`legExposurePct`,
`legCompletionSlippage`,
`marketSession`,
`orderDuration`,
`goodTillDttm`,
`maxMktPctMove`,
`autoHedge`,
`hedgeSession`,
`userData1`,
`userData2`,
`childData`,
`pairStatus`,
`pairDetail`,
`cumSquareFillQty`,
`cumPartialFillQty`,
`avgSquareFillPrc`,
`pairBidPx`,
`pairAskPx`,
`pairBidSz`,
`pairAskSz`,
`timestamp`,
`LegsList`
FROM `SRTrade`.`MsgSRPairLeggerState`
WHERE
/* Replace with a CHAR(19) */
`orderNumber` = 'Example_orderNumber';

Doc Columns Query

SELECT * FROM SRTrade.doccolumns WHERE TABLE_NAME='SRPairLeggerState' ORDER BY ordinal_position ASC;